{% extends "my_ximenwai_base.html" %}
<!--  -->
{% block title %}{{block.super}}-我关注的天涯帖子 {% endblock %}
<!--  -->
{% block content_title %} 我关注的天涯帖子 {% endblock %}
<!--  -->
{% block body %}

<script type="text/javascript">
$().ready(function() {
  $('#ex2').jqm({ajax: '/j/subscribe/get_sub_option?sub_req_id='+sub_req_id, trigger: 'a.ex2trigger'});
});
function get_option_value()
{
			var watch_form=document.getElementById("optionForm");
        	var i=0;
        	var selected_index=-1;
        	
        	for (i=0;i<watch_form.watch.length;i++)
        	{
        		if(watch_form.watch[i].checked)
        		{
        			selected_index=i;
        			break;
        		}
        	}
        	return selected_index;
}

function set_sub_option()
{
	var option=get_option_value();
	//alert(option);
	var sub_req_id=$('#sub_req_id').attr("value");
	//alert(sub_req_id);
	var url = '/j/subscribe/sub_option?sub_req_id='+sub_req_id+'&option='+option;
    $.getJSON(url, function(j){
    	if (j.option ==0){
    		$('#option_'+sub_req_id).attr("innerHTML","只看楼主发贴");	
		}
		if(j.option ==1)
		{
			$('#option_'+sub_req_id).attr("innerHTML","关注所有回复");
		}
		
	});
	$('#ex_sub_option').jqmHide();
}

function show_sub_option(sub_req_id)
      	{
      		//alert("ok");
      		$('#ex_sub_option').jqm({ajax:'/j/subscribe/get_sub_option?sub_req_id='+sub_req_id,modal:false});
      		$('#ex_sub_option').jqmShow();
      	}	
      	
function hide_option()
      	{

      		//$('#ex{{ forloop.counter }}').jqm({ajax:'/j/subscribe/sub?url={{result.q_url}}&title={{result.q_title}}&seq={{ forloop.counter }}',modal:false});
      		$('#ex_sub_option').jqmHide();
      		//$('.jqmWindow').jqmShow();
      	}	
</script>
      	
<script type="text/javascript">
var cart_data = [], vnames = {}, c_data = {}, vids = [];
    //vids.push('10690');
    //vnames['10690'] = '楼高';
    vids.push('1006');
    vnames['1006'] = '分页';
    vids.push('1002');
    vnames['1002'] = '最近回复';
    vids.push('1001');
    vnames['1001'] = '关注人数';
    vids.push('1056');
    vnames['1056'] = '选项';
    
    vids.push('10561');
    vnames['10561'] = '状态';
    
    {% for thread in lst_thread %}
    c_data['781202'] = {id:'{{thread.sub_req_id}}', title:'{{thread.title}}', sid:'{{thread.sub_req_id}}', 
        num:1, sel:true, path:'{{thread.url}}', price:{}, 
        oprice:'{{thread.chrAuthor}}'};
        //c_data['781202'].price['10690'] = '{{thread.floor}}';
        c_data['781202'].price['1006'] = '{{thread.page_cnt}}页';
        c_data['781202'].price['1002'] = '{{thread.latest_post_date}}';
        c_data['781202'].price['1001'] = '<a href="#" title="看看谁和我关注同一个帖子" >{{thread.sub_cnt}}人</a>';
        
        {% ifequal thread.option  0 %}        	
        	c_data['781202'].price['1056'] = '<a title="点击更改设置" id="option_{{thread.sub_req_id}}" href="#" onclick="javascript:show_sub_option(&quot;{{thread.sub_req_id}}&quot;);return false;">只看楼主发贴</a>';
        	//c_data['781202'].price['1056'] = '<a href="#" class="ex2trigger">只看楼主发贴</a>';
        	//alert(c_data['781202'].price['1056']);
        {% else %}
        	//c_data['781202'].price['1056'] = '关注所有回复';
        	c_data['781202'].price['1056'] = '<a title="点击更改设置" id="option_{{thread.sub_req_id}}" href="#" onclick="javascript:show_sub_option(&quot;{{thread.sub_req_id}}&quot;);return false;">关注所有回复</a>';
        {% endifequal %}
        
        {% ifequal thread.status  "RUN" %}
        	c_data['781202'].price['10561'] = 'OK';
        {% endifequal %}
        
        {% ifequal thread.status  "INIT" %}
        	c_data['781202'].price['10561'] = '处理中';
        	c_data['781202'].price['1006'] = '-';
        	c_data['781202'].price['1002'] = '-';
        	c_data['781202'].price['1001'] = '-';
        	//c_data['781202'].price['10690'] = '-';
        {% endifequal %}
        {% ifequal thread.status  "ACCEPTED" %}
        	c_data['781202'].price['10561'] = '处理中.';
        	c_data['781202'].price['1006'] = '-';
        	c_data['781202'].price['1001'] = '-';
        	c_data['781202'].price['1002'] = '-';
        	//c_data['781202'].price['10690'] = '-';
        {% endifequal %}
    cart_data.push(c_data['781202']);
    {% endfor %}
    c_data['781202'] = {id:'781202', title:'『莲蓬鬼话』 [连载]道士育成法——废柴道士的爆笑生活', sid:'1742549', 
        num:1, sel:true, path:'http://www.tianya.cn/techforum/Content/16/637538.shtml', price:{}, 
        oprice:'轩辕小胖'};
        //c_data['781202'].price['10690'] = '548#';
        c_data['781202'].price['1006'] = '6';
        c_data['781202'].price['1002'] = '2010-1-17 2:36:00';
        c_data['781202'].price['1001'] = '121';
        c_data['781202'].price['1056'] = '-';
    //cart_data.push(c_data['781202']);
    
    c_data['781200'] = {id:'781200', title:'见习丘比特', sid:'1957188', 
        num:1, sel:true, path:'/subject/1957188/', price:{}, 
        oprice:'20.0'};
        //c_data['781200'].price['10690'] = '-';
        c_data['781200'].price['1006'] = '-';
        c_data['781200'].price['1002'] = '-';
        c_data['781200'].price['1001'] = '-';
        c_data['781200'].price['1056'] = '14.8';
    //cart_data.push(c_data['781200']);
</script>
<p class="l2">
    
    	以下<span id="total_count2">{{count}}</span>个话题有效跟踪&nbsp;<span class="pl ">
	
    </p>
    <table id="data_list">
    <div id="ex_sub_option" class="jqmWindow" >
Please wait... <img src="http://xmw-static-1.appspot.com/images/busy.gif" alt="loading" />
</div>
        <thead>
            <tr>
                <th>选择:</th>
                <th class="book_title">
                    <a id="select_all" href="javascript:void(0)">全部</a>
                    &nbsp;&nbsp;

                    <a id="select_none" href="javascript:void(0)">无</a>
                </th>
                <th class="sort_tabs">搂主</th>
                <!-- 
                <th class="sort_tabs"><a href="javascript:void(0)" class="choose_vendor" rel="1069" id = "sort_price_1069"><span>楼高</span></a></th>
                 -->
                <th class="sort_tabs"><a href="javascript:void(0)" class="choose_vendor" rel="1006" id = "sort_price_1006"><span>分页</span></a></th>
                <th class="sort_tabs"><a href="javascript:void(0)" class="choose_vendor" rel="1002" id = "sort_price_1002"><span>最近回复时间</span></a></th>

                <th class="sort_tabs"><a href="javascript:void(0)" class="choose_vendor" rel="1001" id = "sort_price_1001"><span>关注人数</span></a></th>
                <th class="sort_tabs"><a href="javascript:void(0)" class="choose_vendor" rel="1056" id = "sort_price_1056"><span>选项</span></a></th>
                <th class="sort_tabs"><a href="javascript:void(0)" class="choose_vendor" rel="10561" id = "sort_price_10561"><span>状态</span></a></th>
                
                <!-- 
                <th class="sort_tabs"><a href="javascript:void(0)" class="choose_vendor" rel="1056" id = "sort_price_1056"><span>九久价↓</span></a></th>
                
                <th class="num_tabs">关注人数</th> -->
                <th class="" align="left" ><a id="clear_cart" href="javascript:;">清空选中</a></th>
            </tr>
        </thead>
        <tbody id="tbody">

        </tbody>
    </table>

    <div id="clear_dialog" class="hidden">
        <h2>要清空已下到购物车的<span class="n_sel"></span>本图书吗？</h2>

        <form method="POST" action=""><div style="display:none;"><input type="hidden" name="ck" value="loZ8"/></div>
            <input type="hidden" name="remove" class="sel_ids" vlaue=""/>
            <div class="tc">
                <input name="submit" type="submit" value="清空"/>
                <input type="button" value="不清空" onclick="pop_win.close()"/>
            </div>
        </form>
        
    </div>
    
  {% endblock %}
     
   